package dao.impl;

import java.sql.SQLException;
import java.util.List;

import com.ibatis.sqlmap.client.SqlMapClient;

import module.Content;
import dao.ABSBasicDAO;
import domain.vo.queryObject;


/**
 * 
* @ClassName: ContentDAOImpl
* @Description: DAO实现类
* @author chenchao
* @date 2013-12-13 上午01:52:12
*
 */
public class ContentDAOImpl extends ABSBasicDAO<Content> {

	/**
	 * 构造方法
	 * @param sqlMapClient
	 */
	public ContentDAOImpl(SqlMapClient sqlMapClient) {
		super(sqlMapClient);
	}
	
	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#getAll()
	 */
	@Override
	public List<Content> getAll() throws SQLException {
		return sqlMapClient.queryForList("Content.getAll");
	}

	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#getById(java.lang.String)
	 */
	@Override
	public Content getById(String id) throws SQLException {
		return (Content)sqlMapClient.queryForList("Content.getById", id);
	}

	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#getByPK()
	 */
	@Override
	public Content getByPK() {
		return null;
	}

	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#insertT(java.lang.Object)
	 */
	@Override
	public void insertT(Content t) throws SQLException {
		sqlMapClient.insert("Content.insertContentInfo", t);
	}

	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#updateT(java.lang.Object)
	 */
	@Override
	public void updateT(Content t) throws SQLException {
		sqlMapClient.update("Content.updateContentInfo", t);
	}
	

	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#countByQueryObject(domain.vo.queryObject)
	 */
	@Override
	public int countByQueryObject(queryObject queryObject) throws SQLException {
		return (Integer)sqlMapClient.queryForObject("Content.countByQueryObject",queryObject);
	}

	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#getObjectByQueryObject(domain.vo.queryObject)
	 */
	@Override
	public List<Content> getObjectByQueryObject(queryObject queryObject)
			throws SQLException {
		return sqlMapClient.queryForList("Content.getObjectByQueryObject", queryObject);
	}

	/* (non-Javadoc)
	 * @see dao.ABSBasicDAO#deleteT(int)
	 */
	@Override
	public void deleteT(int id) throws SQLException {
		sqlMapClient.delete("Content.deleteByID", id);
	}
	

}
